# - Try to find sdl2
#

set(SDL2_VERSION 2.0.9)

find_path(SDL2_INCLUDE_DIR SDL.h
   HINTS ${PREBUILT_LIBRARIES}/SDL2-${SDL2_VERSION}/include
)

find_library(SDL2_LIBRARY NAMES libSDL2.a
   HINTS ${PREBUILT_LIBRARIES}/SDL2-${SDL2_VERSION}/linux/${CMAKE_SYSTEM_PROCESSOR}/lib
)

set(SDL2_LIBRARIES ${SDL2_LIBRARY} sndio)
set(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR} )

include(FindPackageHandleStandardArgs)

# handle the QUIETLY and REQUIRED arguments and set SDL2_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(SDL2 DEFAULT_MSG SDL2_LIBRARY SDL2_INCLUDE_DIR)

mark_as_advanced(SDL2_INCLUDE_DIR SDL2_LIBRARY)
